const express = require('express')
const router = express.Router()

module.exports = (app) => {
  const { controller } = app
  // router.post('/initData', controller.cms.initData)
  // router.get('/getComponentCategory', controller.cms.getComponentCategory)
  // router.post('/deleteComponent', controller.cms.deleteComponent)
  router.post('/addPageJson', controller.cms.addPageJson) // 新增页面数据
  router.post('/updateCmsJson', controller.cms.updateCmsJson) // 编辑页面数据
  router.get('/getPageJson', controller.cms.getPageJson) // 获取当前页数据
  router.get('/getH5PageJson', controller.cms.getH5PageJson) // H5获取页面数据
  router.get('/getPageList', controller.cms.getPageList) // 页面列表
  router.post('/deletePage', controller.cms.deletePage) // 删除页面
  router.post('/updatePageStatus', controller.cms.updatePageStatus) // 更新页面上架状态
  router.get('/getPageAll', controller.cms.getPageAll) // 获取上线的活动页
  router.post('/file/upload', controller.cms.fileUpload) // 文件上传接口
  router.post('/login', controller.cms.login) // 登录
  router.post('/register', controller.cms.register) // 注册
  router.post('/editPwd', controller.cms.editPwd) // 修改密码
  router.get('/getLogList', controller.cms.getLogList) // 日志页面列表
  router.post('/addLog', controller.cms.addLog) // 新增日志记录
  router.get('/getLogNum', controller.cms.getLogNum)
  router.get('/getShopList', controller.cms.getShopList) // 商品页面列表
  router.post('/addShop', controller.cms.addShop)
  router.post('/deleteShop', controller.cms.deleteShop)
  router.post('/editShop', controller.cms.editShop)
  router.get('/getPageIsable', controller.cms.getPageIsable) // 页面是否可用
  router.get('/getUserList', controller.cms.getUserList) // 查询用户列表
  router.post('/deleteUser', controller.cms.deleteUser)
  router.get('/getVisualData', controller.cms.getVisualData)
  return router
}
